package logic

import (
	"context"
	"house123/B/src/model/mysql"

	"house123/B/src/house"
	"house123/B/src/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type UserStatusLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewUserStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserStatusLogic {
	return &UserStatusLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *UserStatusLogic) UserStatus(in *house.UserStatusRequest) (*house.UserStatusResponse, error) {
	// todo: add your logic here and delete this line
	var user = mysql.User{}
	err := user.Status(in.UserId, in.Status)
	if err != nil {
		return nil, err
	}
	return &house.UserStatusResponse{Success: true}, nil
}
